﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SPLBSX.ascx.cs" Inherits="TaoSH.View.SPLBSX" %>


<script src="../../Scripts/avalon.js"></script>

<script>
    var model = avalon.define({
        $id: "SPLB_SX",
        modedata: [],
        NName: "",
        adddata: function () {
            model.modedata.push({ "SXValue": model.NName })
            model.NName = "";
            $(".hidJsonData").val(JSON.stringify(model.modedata.$model))
        },
        deldata: function (el) {
            model.modedata.remove(el);
            $(".hidJsonData").val(JSON.stringify(model.modedata.$model))
        }
    })
    avalon.ready(function () {
        if ($(".hidJsonData").val() != "") {
            model.modedata = $.parseJSON($(".hidJsonData").val());
        }

    })
</script>
<div class="row" ms-controller="SPLB_SX">
    <div class="col-xs-10">
        <div class="form-group">
            <label>类别名称</label>
            <asp:DropDownList runat="server" CssClass="form-control" ID="conLeiBie"  AutoPostBack="True" OnSelectedIndexChanged="conLeiBie_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div class="form-group">
            <label>子类别</label>
            <asp:DropDownList runat="server" CssClass="form-control" ID="conZLeiBie">
            </asp:DropDownList>
        </div>
        <div class="form-group">
            <label>属性名称</label>
            <asp:TextBox ID="conSXName" runat="server" CssClass="form-control"></asp:TextBox>
        </div>

        <table class="table table-bordered table-hover table-hover">
            <thead>
                <tr>
                    <th>名称</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ms-repeat-el="modedata">
                    <td>{{el.SXValue}}</td>
                    <td><a class="text-danger" href="#" ms-click="deldata(el)">删除</a></td>

                </tr>
            </tbody>
            <tfoot>
                <tr>

                    <th>
                        <input type="text" class="form-control" ms-duplex="NName" /></th>
                    <th><a href="#" ms-click="adddata()">新增</a></th>
                </tr>
            </tfoot>
        </table>
    </div>
    <div class="col-xs-2">
    </div>
    <input type="hidden" class="hidJsonData" runat="server" id="hidJsonData" />
</div>





